package com.example.demo.service.serviceimpl;

import com.example.demo.dao.CategoriesDao;
import com.example.demo.entity.CategoriesEntity;
import com.example.demo.service.CategoriesService;
import com.example.demo.vo.CategoriesVo;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CategoriesServiceImpl implements CategoriesService {
    @Resource
    CategoriesDao categoriesDao;
    @Override
    public List<CategoriesEntity> getCategories(int id) {
        return categoriesDao.getCategories(id);
    }

    @Override
    public List<CategoriesEntity> getCategoriesAll() {
        return categoriesDao.getCategoriesAll();
    }

    @Override
    public int addCategories(CategoriesVo categoriesVo) {
        return categoriesDao.addCategories(categoriesVo);
    }

    @Override
    public int updateCategories(CategoriesVo categoriesVo) {
        return categoriesDao.upCategories(categoriesVo);
    }

    @Override
    public int deleteCategories(int id) {
        return categoriesDao.delCategories(id);
    }

    @Override
    public int delCategoriesUserId(int user_id) {
        return categoriesDao.delCategoriesUserId(user_id);
    }
}
